<div class="signin">
  <%=simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
    <%= f.error_notification %>
    <div class="form-inputs">
      <%= f.input :email, required: false, autofocus: true%>
      <%= f.input :password, required: false %>
      <%#= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
    </div>

    <div class="form-actions pull-right">
      <%= f.button :submit, "登录", class: 'btn btn-primary' %>

      <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
        <%= link_to "注册", new_registration_path(resource_name), class: 'btn btn-success' %>
      <% end -%>
      <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
        <%#= link_to "忘记密码", new_password_path(resource_name), class: 'btn btn-warning' %><br />
      <% end -%>
    </div>
    <br />
  <% end %>
  <div>
    其他账号登录
    <br />
    <span id="qqLoginBtn">
      <%#= image_tag("Connect_logo_3.png") %>
    </span>
    <div id="wb_connect_btn"></div>
    <!-- <wb:share-button type="button" size="middle"> </wb:share-button> -->
  </div>
</div>

<script type="text/javascript">
    QC.Login({
       btnId:"qqLoginBtn"    //插入按钮的节点id
    }, function(reqData, opts){//登录成功
       console.log('login success !!!!')
   }, function(opts){//注销成功
    console.log('logout success !!!!')
   });
</script>

<script type="text/javascript">
  // WB2.anyWhere(function (W) {
  //   W.widget.connectButton({
  //       id: "wb_connect_btn",
  //       type: '3,2',
  //       callback: {
  //         login: function (o) { //登录后的回调函数
  //             alert("login: " + o.screen_name)
  //         },
  //         logout: function () { //退出后的回调函数
  //             alert('logout');
  //         }
  //       }
  //   });
  // });
</script>